<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
  targetNamespace="Examples">
  
  <escalation id="escalation" name="escalation" escalationCode="escalationCode" />

  <process id="escalationProcess" isExecutable="true">

    <startEvent id="start" />

    <sequenceFlow sourceRef="start" targetRef="escalationThrowingEvent1" />

    <intermediateThrowEvent id="escalationThrowingEvent1">
      <escalationEventDefinition escalationRef="escalation" />
    </intermediateThrowEvent>

    <sequenceFlow sourceRef="escalationThrowingEvent1" targetRef="FirstTaskInMainprocess" />

    <userTask id="FirstTaskInMainprocess" />

    <sequenceFlow sourceRef="FirstTaskInMainprocess" targetRef="escalationThrowingEvent2" />

    <intermediateThrowEvent id="escalationThrowingEvent2">
      <escalationEventDefinition escalationRef="escalation" />
    </intermediateThrowEvent>

    <sequenceFlow sourceRef="escalationThrowingEvent2" targetRef="SecondTaskInMainprocess" />

    <userTask id="SecondTaskInMainprocess" />

    <sequenceFlow sourceRef="SecondTaskInMainprocess" targetRef="end"></sequenceFlow>

    <endEvent id="end" />

    <subProcess id="escalationEventSubprocess" triggeredByEvent="true">

      <startEvent id="escalationStartEvent" isInterrupting="false">
        <escalationEventDefinition escalationRef="escalation"/>
      </startEvent>

      <sequenceFlow sourceRef="escalationStartEvent" targetRef="TaskInSubprocess" />

      <userTask id="TaskInSubprocess" />

      <sequenceFlow sourceRef="TaskInSubprocess" targetRef="endInEscalationSubprocess" />

      <endEvent id="endInEscalationSubprocess" />

    </subProcess>

  </process>

</definitions>
